#filename:models
from django.db import models

# Create your models here.
class User(models.Model):
	def __unicode__(self):
		return self.name
	GENDER_CHOICES=(
		(0,'Male'),
		(1,'Female')
	)
	name=models.CharField(max_length=200)
	imei=models.CharField(max_length=50)
	password=models.CharField(max_length=50)
	date=models.DateTimeField('regist date')
	email=models.EmailField()
	gender=models.SmallIntegerField(max_length=1,choices=GENDER_CHOICES)
#	avatar=models.SmallIntegerField()
class Humor(models.Model):
	def __unicode__(self):
		return self.title
	title=models.CharField(max_length=200)
	body=models.TextField()
	html=models.TextField()
	tag=models.TextField('tag',max_length=200);
	url=models.TextField('url',max_length=200);
	like=models.IntegerField('like')
	other=models.TextField('others')
	commentcnt=models.IntegerField('commentcnt')
	date=models.DateTimeField('date published')
	user=models.ForeignKey(User)
class Comment(models.Model):
	def __unicode__(self):
		return self.body
	body=models.TextField()
	date=models.DateTimeField('date published')
	user=models.ForeignKey(User)
	humor=models.ForeignKey(Humor)
